import asyncio
from train_model import CaptchaModelTrainer

async def main():
    # 创建训练器实例
    trainer = CaptchaModelTrainer(
        image_height=64,
        image_width=128,
        char_length=4
    )
    
    # 训练模型
    trainer.train(
        train_dir='path/to/train/data',
        validation_dir='path/to/validation/data',
        epochs=50,
        batch_size=32
    )
    
    # 评估模型
    trainer.evaluate('path/to/test/data')

if __name__ == "__main__":
    asyncio.run(main()) 